package com.itheima.three;

public class Demo3 {
    public static void main(String[] args) {
        Person p = new Person("老王", "30");
        Animal a = new Dog();
        p.keepPet(new Dog("2", "黑"), "骨头");
        Dog d = (Dog) a;
        d.lookHome();


        Person p1 = new Person("老李", "25");
        Animal a1 = new Cat("3", "灰");
        p.keepPet(new Cat("3", "灰"), "鱼");
        Cat c = (Cat) a1;
        c.catchMouse();
    }
}

